import React, { FC, memo, Suspense } from "react";

import { IBaseComponentProps } from "@/types/component";

export interface ILazyProps extends IBaseComponentProps {
  component: any;
}

export const LazyComponent: FC<ILazyProps> = memo((props) => {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <props.component />
    </Suspense>
  );
});
